<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="service.*,dao.*,servlet.*,pojo.*,java.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
#content{
width:800px;
margin:0px auto;
border:2px solid #000;
overflow:hidden;
}
.fenlei{
overflow:hidden;
background-color:yellow;
height:30px;
}
.right{
float:right;
}
.liebiao{
overflow:hidden;
width:800px;
}
.pdiv{
width:180px;
height:200px;
margin:10px;
float:left;
}
.pdiv .pimg{
width:80px;
height:100px;
}
img{
width:80px;
height:80px;
}
a.url{
cursor:pointer;
display:block;
width:100%;
height:auto;
}
</style>
</head>
<body>
<jsp:include page="IndexServlet?method=showProductByType"/>
   <div id="content">
   <!-- 电脑专区 -->
    <div class="fenlei">电脑专区<div class="right">更多....</div></div>
    <div class="liebiao">
    <%
   PageBean<Product> pb1 = (PageBean<Product>)(request.getAttribute("pb1"));
      List<Product> list1 = pb1.getList();
      for(Product p:list1){
   %>
     <div class="pdiv">
     <a class="url" href="IndexServlet?method=findProductById&pid=<%=p.getP_id()%>">
       <div class="pimg"><img src="<%=p.getP_image() %>"/></div><br/>
       <div class="pname"><%=p.getP_name() %></div>
       <div class="pprice"><%=p.getP_price() %>&nbsp;&nbsp;&nbsp;</div>
     </a> 
    </div>
   <%
      }
   %>
   </div>
   <!-- 厨卫系列 -->
    <div class="fenlei">厨卫系列<div class="right">更多....</div></div>
      <div class="liebiao">
   <%
   PageBean<Product> pb2 = (PageBean<Product>)(request.getAttribute("pb2"));
      List<Product> list2 = pb2.getList();
      for(Product p:list2){
   %>
    
     <div class="pdiv">
     <a class="url" href="IndexServlet?method=findProductById&pid=<%=p.getP_id()%>">
       <div class="pimg"><img src="<%=p.getP_image() %>"/><br/>
       <%=p.getP_name() %>
       <%=p.getP_price() %>&nbsp;&nbsp;&nbsp;</div>
     </a> 
    </div>
   <%
      }
   %>
   </div>
  <!-- 电视机系列 -->
    <div class="fenlei">电视机系列<div class="right">更多....</div></div>
      <div class="liebiao">
   <%
   PageBean<Product> pb3 = (PageBean<Product>)(request.getAttribute("pb3"));
      List<Product> list3= pb3.getList();
      for(Product p:list3){
   %>
    
     <div class="pdiv">
     <a class="url" href="IndexServlet?method=findProductById&pid=<%=p.getP_id()%>">
       <div class="pimg"><img src="<%=p.getP_image() %>"/></div><br/>
       <div class="pname"><%=p.getP_name() %></div>
       <div class="pprice"><%=p.getP_price() %>&nbsp;&nbsp;&nbsp;</div>
     </a> 
    </div>
   <%
      }
   %></div>
   <!-- 洗衣机系列 -->
   <div class="fenlei">洗衣机系列<div class="right">更多....</div></div>
   <div class="liebiao">
   <%
   PageBean<Product> pb4 = (PageBean<Product>)(request.getAttribute("pb4"));
      List<Product> list4= pb4.getList();
      for(Product p:list4){
   %>
     <div class="pdiv">
     <a class="url" href="IndexServlet?method=findProductById&pid=<%=p.getP_id()%>">
       <div class="pimg"><img src="<%=p.getP_image() %>"/></div><br/>
       <div class="pname"><%=p.getP_name() %></div>
       <div class="pprice"><%=p.getP_price() %>&nbsp;&nbsp;&nbsp;</div>
     </a> 
    </div>
   <%
      }
   %>
   </div>
</body>
</html>